<?php
    //ini_set('display_errors',1);
    include ("lib_db.php");
	include("function.php");
	include("config.php");
	if(!isset($_SESSION)){ session_start();}
if(!isset($_SESSION['user'])){
header('location:login.php');
exit();
}else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xlmns="http://www.w3.org/1999/xhtml">
<head><?php include("view/head.php");?></head>

<body>
<div class="wrapper">
	<div class="header"><?php include ("view/header.php");?></div>
	<div class="clear"></div>
	<div class="content">
		<div class="menu"><?php include("view/menu.php");?></div>
		<div class="center_content">
			<div class="left_content"> <?php include ("view/left_content.php");?></div>
 <?php 
if(isset($_REQUEST['id'])){
$id=$_REQUEST['id'];
$sql="select * from group_product where gid='$id'";
$query=select_one($sql);$gname=$query['gname'];
}
if(isset($_POST['update'])){$nsp=$_REQUEST['nsp'];
$sql="update group_product set gname='$nsp' where gid='$id'";
$query=exec_update($sql);$gname=$nsp;
}
 ?>
			<div class="right_content">
				<h2>Sửa nhóm sản phẩm</h2>
                <form action="" method="POST">              
    				<table>
                        <tr class="title">
                            <td><span>Tên nhóm sản phẩm:</span></td>
                            <td><input type="text" value="<?php echo $gname;?>" style="width:240px" name="nsp"></td>
                        </tr>
                        <tr class="value">
                            <td></td>
                            <td>
                                <input type="reset" value="Hủy" name="reset"/>
                                <input type="submit" value="Cập nhật" name="update"/>
                            </td>
                        </tr>
                    </table>
                </form>
		  </div>
          <div class="right_content">
				<h2>Nhóm sản phẩm</h2>
				<?php echo group_pd();?>
				<!--a class="bt_green" href="#"><span class="bt_green_lft"></span><strong>Add new item</strong><span class="bt_green_r"></span></a>
				<a class="bt_blue" href="#"><span class="bt_blue_lft"></span><strong>View all items from category</strong><span class="bt_blue_r"></span></a>
				<a class="bt_red" href="#"><span class="bt_red_lft"></span><strong>Delete items</strong><span class="bt_red_r"></span></a>
				
				<div class="items">
					<span class="disabled"><< prev</span>
					<span class="current">1</span>
					<a href="">2</a>
					<a href="">3</a>
					<a href="">4</a>
					<a href="">5</a>…<a href="">10</a>
					<a href="">11</a>
					<a href="">12</a>...<a href="">100</a>
					<a href="">101</a>
					<a href="">next >></a>
				</div-->
		  </div>
	</div>
	<div class="clear"></div>
	<div class="footer">
		<div class="left_ft">
			<span>IN ADMIN PANEL | Powered by</span>
			<a href="http://indeziner.com">INDEZINER</a>
		</div>
		<div class="right_ft">
			<a href="http://indeziner.com"><img border="0" title="" alt="" src="images/indeziner_logo.gif"></a>
		</div>
	</div>
</div>
</body>
</html>
<?php } ?>